// import导入包的语句要写在第一行
import java.util.*;
import java.sql.*;

class Student{
    private String name;
    private int age;
    static private String classRoom;
    // 实例代码块
    {
        name = "张三";
        age = 18;
        System.out.println("I am instance block");
    }
    // 静态代码块
    static{
        classRoom = "401";
        show();
        System.out.println("I am static block");
    }
    // 打印函数
    static public void show(){
        System.out.println();
    }
}

public class Test {
    public static void main(String[] args) {
        Student s1 = new Student();
        Student s2 = new Student();
    }
}

//import static java.lang.Math.*;

//class Student{
//    public String name = "张三";
//    static void show(){
//        System.out.println(name);
//    }
//}

//class Student{
//    private static String classRoom = "401";
//}

//public class Test {
//    public static void main(String[] args) {
//        {
//            int x = 10;
//            System.out.println("x = " + x);
//        }
//        int y = 20;
//        System.out.println("y = " + y);
//    }
//}

//public class Test {
//    public static void main(String[] args) {
//        Student s1 = new Student();
//        Student s2 = new Student();
//        System.out.println();
//    }
//}

//public class Test {
//    public static void main(String[] args) {
//        double x = 10;
//        double y = 20;
//        // 静态导入的方式写起来更方便一些.
//        // double result = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
//        double ret = sqrt(pow(x,2) + pow(y,2));
//        System.out.println(ret);
//    }
//}

//public class Test {
//    public static void main(String[] args) {
//        java.util.Date date = new java.util.Date();
//        System.out.println(date.getTime());
//    }
//}

//public class Test {
//    public static void main(String[] args) {
//        Date date = new Date();
//        System.out.println(date.getTime());
//    }
//}

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86158
 * Date: 2023-06-07
 * Time: 20:31
 */

//class Student{
//    public String name;
//    int age;
//    private String weight;
//}

//public class Test {
//    public static void main(String[] args) {
//        java.util.Date date = new java.util.Date();
//        // 得到一个毫秒级别的时间戳
//        System.out.println(date.getTime());
//    }
//}

//public class Test {
//    public static void main(String[] args) {
//        Student s = new Student();
//        System.out.println(s.name);    // public属性： 可以任何其他类访问
//        System.out.println(s.age);     // default属性：只能被本包中类访问
//        //System.out.println(s.weight);// private属性：只能在Student类中访问，不能被其他类访问
//    }
//}
